package com.uwo.commons.samples.beans;

import com.uwo.commons.configuration.aop.validate.annotation.Length;
import com.uwo.commons.configuration.aop.validate.annotation.Model;
import com.uwo.commons.configuration.aop.validate.annotation.Number;
import com.uwo.commons.configuration.aop.validate.annotation.Pattern;
import lombok.Data;

import java.io.Serializable;

/**
 * 用户信息
 * @author hao.yan
 */
@Data
@Model(validateBean = "modelValidate", method = "validateMember")
public class Member implements Serializable {

    private Long id;

    @Number(min = 18, max = 80)
    private Integer age;

    @Number(min =0, max = 2)
    private Integer sex;

    @Length(max = 150)
    private String describe;

    @Pattern(pattern = "(^\\d{18}$)|(^\\d{15}$)")
    private String idCard;

}
